#Title
This repository contains the replication material of the article "The Consequences of Using a Top 5 System in Nevada", by Jeremy Gelman, Evan Pritsos, and Benajamin Reilly. 

## Data
convenience_numeric #Conveninence survey sample with numeric output as variables
convenience_text #Conveninence survey sample with text output as variables
dynata_numeric #Online survey sample with numeric output as variables
dynata_text #Online survey sample with text output as variables

# Simulation results
generic_general.csv
generic_primary.csv
generic_primary_agg.csv
gov22_general.csv
gov22_primary.csv
gov22_primary_agg.csv
gov26_general.csv
gov26_primary.csv
gov26_primary_agg.csv
sen24_general.csv
sen24_primary.csv
sen24_primary_agg.csv

## Required Software and Packages
Python (3.9): 
pyrankvote
os
pandas
numpy
random
time

R (4.2.2)
ggplot2
stringr
dplyr
gridExtra

STATA (14 or higher)

## Code
1. top5_analysis.R #R code to reproduce tables and figures.
2. generic.py #Python code that runs the simulations for the generic election. 
3. governor22.py #Python code that runs the simulations for the 2022 Governor election.
3. senate24.py #Python code that runs the simulations for the 2024 Senate election.
4. governor26.py #Python code that runs the simulations for the 2026 Governor election.